<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<title>个人中心</title>
		<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no' name='viewport' />
		<link rel="stylesheet" href="assets/css/bootstrap.min.css">
		<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i">
		<link rel="stylesheet" href="assets/css/ready.css">
		<link rel="stylesheet" href="assets/css/demo.css">

		<script src="../homePage/js/jquery-1.9.1/jquery.js"></script>
		<script src="bootstrap/js/bootstrap.js"></script>
		<script src="angularjs/angular.min.js"></script>
		<script src="layer/layer.js"></script>
	</head>
	<style type="text/css">
		.main-panel {
			background-color: #FFFFFF !important;
		}
		.content {
			background-color: #FFFFFF !important;
		}
	</style>
	<body ng-app="myApp" ng-controller="myCtrl" ng-init="myinit()">
		<div class="wrapper">
			<div class="main-header">
				<div class="logo-header">
					<a href="../homePage/index.html" class="logo">
						<img src="../homePage/img/logo.png" style="height: 40px;width: 100px">个人中心
					</a>
					<button class="navbar-toggler sidenav-toggler ml-auto" type="button" data-toggle="collapse" data-target="collapse"
					 aria-controls="sidebar" aria-expanded="false" aria-label="Toggle navigation">
						<span class="navbar-toggler-icon"></span>
					</button>
					<button class="topbar-toggler more"><i class="la la-ellipsis-v"></i></button>
				</div>
				<nav class="navbar navbar-header navbar-expand-lg">
					<div class="container-fluid">
						<a href="../homePage/index.html" style="color: #000000; font-size: 16px;">返回首页</a>

						<ul class="navbar-nav topbar-nav ml-md-auto align-items-center">


							<li class="nav-item dropdown">当前用户:
								<a class="dropdown-toggle profile-pic" data-toggle="dropdown" href="#" aria-expanded="false">
									<tbody>{{username}}</tbody>
								</a>
								<ul class="dropdown-menu dropdown-user">
									<li>
										<div class="user-box">

											<div class="u-text">
												<h4>{{myuser.username}}</h4>
												<p class="text-muted">{{userinfo.email}}</p>
												<a onclick="quiet()" class="btn btn-rounded btn-danger btn-sm">退出登录</a>
											</div>
										</div>
									</li>

								</ul>
								<!-- /.dropdown-user -->
							</li>
						</ul>
					</div>
				</nav>
			</div>
			<div class="sidebar">
				<div class="scrollbar-inner sidebar-wrapper">
					<div class="user">
						<div class="info">
							<a class="" data-toggle="collapse" href="#collapseExample" aria-expanded="true">
								<span>
									<span class="user-level">修改信息</span>
									<!-- <span class="badge badge-count">未实名</span> -->
									<span class="caret"></span>
								</span>
							</a>
							<div class="clearfix"></div>

							<div class="collapse in" id="collapseExample" aria-expanded="true" style="">
								<ul class="nav">
                                    <li>
                                        <a href="password.html">
                                            <span class="link-collapse">修改密码</span>
                                        </a>
                                    </li>
									<li>
										<a href="authentication.html">
											<span class="link-collapse">实名认证</span>
										</a>
									</li>
									<li>
										<a href="update.html">
											<span class="link-collapse">编辑资料</span>
										</a>
									</li>
									<li>
										<a href="gobindcar.html">
											<span class="link-collapse">绑定车辆</span>
										</a>
									</li>
								</ul>
							</div>
						</div>
					</div>
					<ul class="nav">
						<li class="nav-item active">
							<a href="home.html">
								<i class="la la-fonticons"></i>
								<p>首页管理</p>
								<!-- <span class="badge badge-count">5</span> -->
							</a>
						</li>
						<li class="nav-item">
							<a href="myOrder.html">
								<i class="la la-dashboard"></i>
								<p>我的订单</p>
								<!-- <span class="badge badge-count">5</span> -->
							</a>
						</li>
						<li class="nav-item">
							<a href="guarantee.html">
								<i class="la la-table"></i>
								<p>我的保单</p>
								<!-- <span class="badge badge-count">14</span> -->
							</a>
						</li>
						<li class="nav-item">
							<a href="claim.html">
								<i class="la la-keyboard-o"></i>
								<p>我的理赔</p>
								<!-- <span class="badge badge-count">50</span> -->
							</a>
						</li>
						<li class="nav-item">
							<a href="bindcar.html">
								<i class="la la-th"></i>
								<p>我的车辆</p>
								<!-- <span class="badge badge-count">6</span> -->
							</a>
						</li>
						<li class="nav-item">
							<a href="applyclaim.html">
								<i class="la la-th"></i>
								<p>申请理赔</p>
								<!-- <span class="badge badge-count">6</span> -->
							</a>
						</li>
					</ul>
				</div>
			</div>
			<div class="main-panel">
				<div class="content">
					<div class="container-fluid">
						<div class="row">
							<div class="col-md-10">
								<div class="card">
									<div class="card-header bg-danger">
										<h4 class="card-title">待完成事项</h4>
									</div>
									<div class="card-body table-bordered">
										<ul style="list-style-type:none;" class="text-center">
											<li id="username" style="float: left;width: 250px">
												<p><img src="assets/img/username.jpg" style="width: 60px;height: 60px" /></p>
												<p>您还没有设置用户名</p>
												<a href="update.html" class="btn btn-default">设置</a>
											</li>
											<li id="password" style="float: left;width: 250px">
												<p><img src="assets/img/password.jpg" style="width: 60px;height: 60px" /></p>
												<p>您还没有设置密码</p>
												<a href="password.html" class="btn btn-default">设置</a>
											</li>
											<li id="usertel"  style="float: left;width: 250px">
												<p><img src="assets/img/phone.jpg" style="width: 60px;height: 60px" /></p>
												<p>您还没有绑定手机号</p>
												<a href="update.html" class="btn btn-default">绑定</a>
											</li>
											<li id="email"style="float: left;width: 250px;">
												<p><img src="assets/img/email.jpg" style="width: 60px;height: 60px"/></p>
												<p>您还没有绑定邮箱</p>
												<a href="update.html" class="btn btn-default">绑定</a>
											</li>
										</ul>
									</div>
									<div class="card-body table-bordered">
										<div id="idnumber" class="text-center"  >
											<img src="assets/img/idcard.jpg"style="width: 60px;height: 60px" />
											<p>您还没有实名认证</p>
											<a href="authentication.html" class="btn btn-default">认证</a>
										</div>
									</div>
									<div class="card-body table-bordered">
										<div id="bankcard" class="text-center">
											<img src="assets/img/card.jpg" style="width: 60px;height: 60px"/>
											<p>您还没有绑定银行卡</p>
											<a href="update.html" class="btn btn-default">绑定</a>
										</div>
									</div>
								</div>
								<div class="card">
									<div class="card-header bg-success">
										<h4 class="card-title">已完成事项</h4>
									</div>
									<div class="card-body table-bordered">
										<ul style="list-style-type:none;" class="text-center">
											<li id="username1" style="float: left;width: 250px">
												<p><img src="assets/img/username.jpg" style="width: 60px;height: 60px" /></p>
												<p>{{user.username}}</p>
												<a href="update.html" class="btn btn-default">修改</a>
										</li>
											<li id="usertel1"  style="float: left;width: 250px">
													<p><img src="assets/img/phone.jpg" style="width: 60px;height: 60px" /></p>
													<p id="pusertel">{{user.usertel}}</p>
													<a href="update.html" class="btn btn-default">修改</a>

										</li>
											<li id="email1"  style="float: left;width: 250px">
													<p><img src="assets/img/email.jpg" style="width: 60px;height: 60px"/></p>
													<p>{{userinfo.email}}</p>
													<a href="update.html" class="btn btn-default">修改</a>


										</li>
										</ul>
									</div>
									<div class="card-body table-bordered">
										<div id="idnumber1" class="text-center"  >
											<img src="assets/img/idcard.jpg"style="width: 60px;height: 60px" />
											<p>已实名</p>
											<p>认证成功</p>
										</div>
									</div>
									<div class="card-body table-bordered">
										<div id="bankcard1" class="text-center">
											<img src="assets/img/card.jpg" style="width: 60px;height: 60px"/>
											<tbody id="tb"></tbody>
											<p>银行卡已绑定</p>
											<a href="update.html" class="btn btn-default">修改</a>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<footer class="footer">
					<div class="container-fluid">
						<nav class="pull-left">
							<ul class="nav">
								<li class="nav-item">
									<a class="nav-link" href="#">
										ThemeKita
									</a>
								</li>
								<li class="nav-item">
									<a class="nav-link" href="#">
										Help
									</a>
								</li>
								<li class="nav-item">
									<a class="nav-link" href="#license/#free-item">
										Licenses
									</a>
								</li>
							</ul>
						</nav>
						<div class="copyright ml-auto">
							Copyright &copy; 2020 无忧车险责任有限公司
						</div>
					</div>
				</footer>
			</div>
		</div>
	</body>
	<script src="assets/js/core/jquery.3.2.1.min.js"></script>
	<script src="assets/js/plugin/jquery-ui-1.12.1.custom/jquery-ui.min.js"></script>
	<script src="assets/js/core/popper.min.js"></script>
	<script src="assets/js/core/bootstrap.min.js"></script>
	<script src="assets/js/plugin/chartist/chartist.min.js"></script>
	<script src="assets/js/plugin/chartist/plugin/chartist-plugin-tooltip.min.js"></script>
	<script src="assets/js/plugin/bootstrap-notify/bootstrap-notify.min.js"></script>
	<script src="assets/js/plugin/bootstrap-toggle/bootstrap-toggle.min.js"></script>
	<script src="assets/js/plugin/jquery-mapael/jquery.mapael.min.js"></script>
	<script src="assets/js/plugin/jquery-mapael/maps/world_countries.min.js"></script>
	<script src="assets/js/plugin/chart-circle/circles.min.js"></script>
	<script src="assets/js/plugin/jquery-scrollbar/jquery.scrollbar.min.js"></script>
	<script src="assets/js/ready.min.js"></script>
	<script src="assets/js/demo.js"></script>
	<script>
        function quiet() {
            sessionStorage.clear();
            window.location.href = "../homePage/index.html";
        }
        var app = angular.module("myApp",[]);
        app.controller("myCtrl",function ($scope,$http) {
            $scope.myuser = sessionStorage.getItem("user");
            $scope.userid = JSON.parse($scope.myuser).userid;
            $scope.username = JSON.parse($scope.myuser).username;
            $scope.myinit = function () {
                $http.get("http://localhost:8002/tuser/showinfo/"+$scope.userid).success(function (data) {
                    $scope.user = data.data;
                    if ( $scope.user.username != ""){
                        $("#username").hide()
                    }
                    if ( $scope.user.usertel != ""){
                        $("#usertel").hide()
                    }
                    if ( $scope.user.password != ""){
                        $("#password").hide()
                    }
                    if ( $scope.user.username == ""){
                        $("#username1").hide()
                    }
                    if ( $scope.user.usertel == null ){
                        $("#usertel1").hide()
                    }
                    $scope.checkbankcard();
                    $scope.checkuserinfo();
                });
            };
            $scope.checkbankcard = function () {
                $http.get("http://localhost:8002/bank/selectAllBank/"+$scope.userid).success(function (data) {
                    $scope.bank= data.data;
                    if ( $scope.bank !=null){
                        $("#bankcard").hide()
                        var c = "";
                        $( $scope.bank).each(function (i,v) {
                            c += "<p>"+v.bankcard+"</p>";
                        });
                        $("#tb").html(c)
                    }else{
                        $("#bankcard1").hide()
                    }
                });
            };
            $scope.checkuserinfo = function () {
                $http.get("http://localhost:8002/tuser/userinfo/"+$scope.userid).success(function (data) {
                    $scope.userinfo = data.data
                    if($scope.userinfo.idnumber != null ){
                        $("#idnumber").hide()
                    }else{
                        $("#idnumber1").hide()
                    }

                    if($scope.userinfo.email != null){
                        $("#email").hide()
                    }else{
                        $("#email1").hide()
                    }

                });
            };
        })

	</script>

</html>
